<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="从" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: chen
  Date: 17-9-14
  Time: 下午4:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>Title</title>

    <link rel="stylesheet" href="${basePath}/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="${basePath}/static/css/all.css" >

    <script src="${basePath}/static/js/jquery-3.2.1.min.js"></script>
    <script src="${basePath}/static/js/bootstrap.min.js"></script>
    <script src="${basePath}/static/js/function.js" type="text/javascript"></script>
</head>
<body>
    <div style="width: 100%">
        <div id="div_userInfo" style="width: 600px">
            <ul class="nav nav-tabs" id="ul_nav">
                <li role="presentation" class="ul_title"><a href="${basePath}" id="btn_back">返回首页</a></li>
                <li role="presentation" class="ul_title" url="${basePath}/user/userData"><a id="btn_userData" href="#">用户信息</a></li>
                <li role="presentation" class="ul_title" url="${basePath}/lease/getLeaseByStudentId"><a id="btn_leaseData" href="#">书本信息</a></li>
                <li role="presentation" class="ul_title" url="${basePath}/user/modifyPassword"><a id="btn_modifyPassword" href="#">修改密码</a></li>
            </ul>
            <iframe id="if_showIframe" src="userData" frameborder="0" height="300" width="600px"></iframe>
        </div>
    </div>
<script type="text/javascript">
    var iframe = $("iframe#if_showIframe");
    var btn_userData = $("a#btn_userData");
    var btn_leaseData = $("a#btn_leaseData");
    var btn_modifyPassword = $("a#btn_modifyPassword");
    var ul = $("ul#ul_nav");

    /**
     * 清除标题栏的所有选中状态
     */
    function clear_ul() {
        $("li.ul_title").each(function () {
            $(this).removeClass("active");
        });
    }


    /**
     *  页面初始化工作
     */
    $(function () {
        switchIframeAndChangeButton(ul,iframe,${sign});
    });

    /**
     * 实现返回按钮 返回历史中的上个页面
     * 最简单最先实现
     */

    btn_userData.click(function () {
        switchIframeAndChangeButton(ul,iframe,1);
    });
    btn_leaseData.click(function () {
        switchIframeAndChangeButton(ul,iframe,2);
    });
    btn_modifyPassword.click(function () {
        switchIframeAndChangeButton(ul,iframe,3);
    });
</script>
</body>
</html>
